﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LeaveHome.aspx.cs" Inherits="SMSSnew.UI.LeaveHome"
    EnableEventValidation="true" %>

<link href="../../css/StyleSheet.css" rel="stylesheet" type="text/css" />
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript">
    processConfirm = function() {
        var result = confirm("Are you sure you want to delete this?");
        if (!result) {
            alert("Cancelled"); //or set a label or whatever
            return false; //cancel postback
        }
        return true; //perform postback
    }
</script>

<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .RadGrid_Default
        {
            border: 1px solid #232323;
        }
        .RadGrid_Default
        {
            font: 11px/1.4 arial,sans-serif;
        }
        .RadGrid_Default
        {
            background: #d4d0c8;
            color: #333;
        }
        .GridHeader_Default
        {
            color: #fff;
            text-decoration: none;
        }
        .GridHeader_Default
        {
            border-bottom: 1px solid #010101;
            background: url('mvwres://Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.headers.gif') repeat-x #434343;
            padding: 10px 6px 10px 11px;
            text-align: left;
            font-size: 1.3em;
            font-weight: normal;
        }
        .GridFooter_Default
        {
            color: #666;
        }
    </style>
</head>
<body>
    <div class="container">
        <form id="form1" runat="server" class="well span11 text-center">
        <p align="left">
            <table width="100%">
                <tr>
                    <td align="left">
                        <asp:ImageButton ID="imgBtnBack" runat="server" ImageUrl="~/IMAGES/back.png" OnClick="imgBtnBack_Click"
                            ToolTip="Back" />
                    </td>
                    <td align="right">
                        <asp:LinkButton ID="lnkBtnLogout" runat="server" PostBackUrl="~/UI/Login.aspx" Font-Underline="True"><h5>Logout</h5></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </p>
        <h4 class="text-info">
            Teacher Leave Application Form</h4>
        <table width="100%" class="table container text-left">
            <tr>
                <td colspan="4"  class="style1">  
                    <asp:Label ID="lblTitle" runat="server" Text="Leave Application Summary" 
                        CssClass="text-info" Font-Bold="True"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <telerik:RadGrid ID="grdRequestedLeaves" runat="server" AutoGenerateColumns="False"
                        GridLines="None" PageSize="10" AllowPaging="true" AllowSorting="true" Skin="WebBlue" OnItemCommand="grdRequestedLeaves_ItemCommand">
                        <MasterTableView GroupLoadMode="Client">
                            <RowIndicatorColumn Visible="False">
                                <HeaderStyle />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn Resizable="False" Visible="False">
                                <HeaderStyle />
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="LEAVE_ID" HeaderText="Leave ID" SortExpression="LEAVE_ID"
                                    UniqueName="leaveId">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="START_DATE" HeaderText="Start Date" SortExpression="START_DATE"
                                    UniqueName="startDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="END_DATE" HeaderText="End Date" SortExpression="END_DATE"
                                    UniqueName="endDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DURATION" HeaderText="Duration" SortExpression="DURATION"
                                    UniqueName="duration" >
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="REASON" HeaderText="Reason" SortExpression="REASON""
                                    UniqueName="reason">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LEAVE_STATUS" HeaderText="Leave Status" SortExpression="LEAVE_STATUS"
                                    UniqueName="leaveStatus">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LEAVE_TYPE_NAME" HeaderText="Leave Type" SortExpression="LEAVE_TYPE_NAME"
                                    UniqueName="leaveType">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LEAVE_CATEGORY" HeaderText="Leave Category" SortExpression="LEAVE_CATEGORY"
                                    UniqueName="leaveCategory">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgBtnDelete" runat="server" AlternateText="Delete leave" CommandName="deleteLeave"
                                            OnClientClick="javascript:if(!confirm('This action will delete the selected leave. Are you sure?')){return false;}"
                                            ImageUrl="../../IMAGES/clear.gif" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldAlias="Status" FieldName="LEAVE_STATUS" HeaderValueSeparator=" : " />
                                    </GroupByFields>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldAlias="Status" FieldName="LEAVE_STATUS" HeaderValueSeparator=" : " />
                                    </SelectFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <EditFormSettings>
                                <PopUpSettings ScrollBars="None" />
                            </EditFormSettings>
                        </MasterTableView>
                    </telerik:RadGrid>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    Request New
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="imgButFullDay" runat="server" ToolTip="Full Day Leave" OnClick="imgButFullDay_Click"
                        Text="Full Day Leave" class="btn btn-link" Font-Size="Large" />
                </td>
                <td>
                    <asp:Button ID="imgButHalfDay" runat="server" ToolTip="Half Day Leave" OnClick="imgButHalfDay_Click"
                        Text="Half Day Leave" class="btn btn-link" Font-Size="Large" />
                </td>
                <td>
                    <asp:Button ID="imgButShortLeave" runat="server" ToolTip="Short Leave" OnClick="imgButShortLeave_Click"
                        Text="Short Leave" class="btn btn-link" Font-Size="Large" />
                </td>
                <td>
                    <asp:Button ID="imgButSpecialMedical" runat="server" ToolTip="Special Medical" Text="Special Medical Leave"
                        class="btn btn-link" Font-Size="Large" 
                        onclick="imgButSpecialMedical_Click" />
                </td>
                </td>
            </tr>
        </table>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <asp:HiddenField ID="hdnFieldDelete" runat="server" />
        </form>
    </div>
</body>
</html>
